package com.xiaoc.bulldozer.common.service.impl;

import java.util.List;
import javax.annotation.Resource;

import com.xiaoc.bulldozer.common.dto.AppointmentDto;
import org.springframework.stereotype.Service;
import com.xiaoc.bulldozer.common.dao.AppointmentMapper;
import com.xiaoc.bulldozer.common.dto.AppointmentQueryDto;
import com.xiaoc.bulldozer.common.model.Appointment;
import com.xiaoc.bulldozer.common.service.AppointmentService;

/**
 * Appointment Service 实现类
 * 
 * @author wj
 * 
 * @date 2019-04-29 09:49:19
 */
@Service("appointmentService")
public class AppointmentServiceImpl implements AppointmentService {

    @Resource
    private AppointmentMapper appointmentMapper;


    @Override
    public Integer getAppointmentCountByCondition(AppointmentQueryDto appointmentQueryDto) {
        return appointmentMapper.getAppointmentCountByCondition(appointmentQueryDto);
    }

    @Override
    public List<Appointment> getAppointmentListByCondition(AppointmentQueryDto appointmentQueryDto) {
        return appointmentMapper.getAppointmentListByCondition(appointmentQueryDto);
    }

    @Override
    public Appointment getAppointmentById(Integer id) {
        return appointmentMapper.getAppointmentById(id);
    }

    @Override
    public List<Appointment> getAllAppointmentList() {
        return appointmentMapper.getAllAppointmentList();
    }
    
    @Override
    public void save(Appointment appointment) {
        appointmentMapper.save(appointment);
    }

    @Override
    public void update(Appointment appointment) {
        appointmentMapper.update(appointment);
    }

    @Override
    public void deleteById(Integer id) {
        appointmentMapper.deleteById(id);
    }

    @Override
    public List<Appointment> getAppointmentListByPhone(String phone) {
        return appointmentMapper.getAppointmentListByPhone(phone);
    }

    @Override
    public List<AppointmentDto> getMyAppointmentListByPhoneOrAccountId(String phone, Integer accountId) {
        return appointmentMapper.getMyAppointmentListByPhoneOrAccountId(phone, accountId);
    }

    @Override
    public Integer getCountByManagerAccountId(AppointmentQueryDto appointmentQueryDto) {
        return appointmentMapper.getCountByManagerAccountId(appointmentQueryDto);
    }

    @Override
    public List<AppointmentDto> getAppointmentListByManagerAccountId(AppointmentQueryDto appointmentQueryDto) {
        return appointmentMapper.getAppointmentListByManagerAccountId(appointmentQueryDto);
    }

}
